#!/bin/sh

##------- Global settings ----------------------------------------------------

ARCONFIG="`which arevi-config`"
if [ ! -x "${ARCONFIG}" ] ; then
  echo "Cannot find arevi-config !"
  exit 1
fi

ARDIR="`${ARCONFIG} --install`"
ARLIB="${ARDIR}/lib"

HDIR="../.."
HLIB="${HDIR}/lib"
HINC="${HDIR}/include"

CCFLAGS="-I${HINC} \
         `${ARCONFIG} --cflags --debug`"
LDFLAGS="-L${HLIB} -lAReViHLib2 \
         `${ARCONFIG} --ldflags --debug`"

LIB_HINT="`${ARCONFIG} --libvar`"
LIB_HINT="export ${LIB_HINT}=\\\$\$${LIB_HINT}:${ARLIB}:${HLIB}:."

##------- Executable settings ------------------------------------------------

EXEC_TARGET="testShader"

testShader_FILES="testShader.cpp"

##----------------------------------------------------------------------------
# Generate `makefile' according to the above settings

set ARLIB HLIB LIB_HINT
. ${ARLIB}/build-makefile > makefile

##------- Inserted in makefile -----------------------------------------------
# Specific targets can be resolved before/after `all' or `clean' are called

post_all :
	@if [ ! -h ./GLFonts ] ; then ln -sf ${ARLIB}/GLFonts . ; fi
	@if [ ! -h ./BMFonts ] ; then ln -sf ${ARLIB}/BMFonts . ; fi
	@echo ; echo "  ${LIB_HINT}" ; echo

pre_clean :
	rm -f GLFonts BMFonts snap.*

##----------------------------------------------------------------------------
